<template>
	<view>
		<u-navbar :fixed="true" :placeholder="true" title="内部维修" @leftClick="leftClick" bgColor="#0F53AC"
			leftIconColor="#fff">
		</u-navbar>
		<u-sticky bgColor="#fff">
			<u-tabs :list="tabList" lineWidth="80" lineColor="#0F53AC" :activeStyle="activeStyle" :scrollable="false"
				:inactiveStyle="inactiveStyle" :itemStyle="itemStyle" @click="tabsClick" :current="current">
			</u-tabs>
		</u-sticky>
		<u-gap height="1" bgColor="#f2f2f2"></u-gap>
		<view v-show="current==0">
			<view class="gz-icon" style="margin-top: 2rpx;">
				<view class="title">故障描述</view>
				<view class="desc-reason1" style="margin-top: 3px;">{{dataInfo.description}}</view>
			</view>
			<view class="gz-icon">
				<view class="title">故障照片</view>
				<view class="icon-list">
					<!-- 		<u-album style="width: 105px;" v-if="imgList.length>0" :urls="imgList"  :multipleSize="'105'" :singleSize="'105'"
					></u-album>
					<video style="width: 105px;height: 105px;" v-for="v in viList" :src="v" controls></video> -->
					<image style="width: 210rpx;height: 210rpx;margin: 6rpx;" @tap="previewImage(v,imgList)"
						v-for="v in imgList" :src="v"></image>
					<video style="width: 210rpx;height: 210rpx;margin: 6rpx;" v-for="v in viList" :src="v"></video>
				</view>
			</view>
			<view class="bx-list detail-title-border">
				<view class="bx-list-title" @click="togohitchSelect()">
					<view class="left">
						<view class="red">*</view>故障类型
					</view>
					<view class="right1">
						<view>请选择</view>
						<view class="iconfont icon-app-xiangyou"></view>
					</view>
				</view>
				<view class="select-look" v-if="infoParams.failureCategory">
					<text class="look-item">
						{{infoParams.failureCategory}}
					</text>
				</view>
			</view>
			<view class="bx-list detail-title-border" style="margin-top: 2rpx;">
				<view class="bx-list-title" @click="togoSymptoms">
					<view class="left">
						<view class="red">*</view>故障现象
					</view>
					<view class="right1">
						<view>请选择</view>
						<view class="iconfont icon-app-xiangyou"></view>
					</view>
				</view>
				<view class="select-look" v-if="infoParams.failurePhenomenon">
					<text class="look-item">
						{{infoParams.failurePhenomenon}}
					</text>
				</view>
			</view>
			<view class="kiss-upDown-list bx-list detail-title-border padding1">
				<view class="bx-list-title">
					<view class="left">
						<view class="red">*</view>解决方案
					</view>
				</view>
				<view class="input-textrea">
					<u--textarea class="textrea" v-model="infoParams.solution" placeholder="请输入解决方案"
						@input="changeSolution" maxlength="128"></u--textarea>
				</view>
			</view>
			<view class="bx-list detail-title-border">
				<view class="bx-list-title" @click="togoPopGrade">
					<view class="left">
						<view class="red">*</view>故障等级
					</view>
					<view class="right1">
						<!-- <view>请选择</view> -->
						<view :class="[infoParams.failureLevel!=''?'select-bg':'']">
							{{infoParams.failureLevel!=''?infoParams.failureLevel:'请选择'}}
						</view>
						<view v-if="infoParams.failureLevel == ''" class="iconfont icon-app-xiangyou"></view>
					</view>
				</view>
			</view>
			<view class="kiss-upDown-list bx-list detail-title-border padding1">
				<view class="bx-list-title">
					<view class="left">
						<view class="red">*</view>维修内容
					</view>
				</view>
				<view class="input-textrea">
					<u--textarea class="textrea" v-model="infoParams.content" placeholder="请输入维修内容"></u--textarea>
				</view>
			</view>
			<view class="bx-title padding2">
				<view class="left">
					<view class="red">*</view>维修照片<view style="color: #8c8c8c;">(可传视频或图片，最多9个)</view>
				</view>
			</view>
			<view class="bx-upload">
				<uploadVideo @getdata="getdata" @delete="deletePicture" :fileType="13" :file="file">
				</uploadVideo>
			</view>
			<u-gap height="1" bgColor="#f2f2f2"></u-gap>
			<view class="bx-list detail-title-border">
				<view class="bx-list-title" @click="togoPeopleSelect(2)">
					<view class="left">
						<view class="red">*</view>验证人
					</view>
					<view class="right1">
						<view :class="[infoParams.verifyUserName!=''?'select-bg':'']">
							{{infoParams.verifyUserName!=''?infoParams.verifyUserName:'选择人员'}}
						</view>
						<view v-if="infoParams.verifyUserName==''" class="iconfont icon-app-xiangyou"></view>
					</view>
				</view>
			</view>

		</view>
		<view v-show="current==1">
			<spareParts :bjapplyList="bjapplyList" :realName="dataParams.dealUserName"
				@addBeijianChange="addBeijianChange(1)" @togoComfirApplybtn="togoComfirApplybtn"
				@deleteBjItem="deleteBjItem" @togoPeopleSelect="togoPeopleSelect(5)"></spareParts>

		</view>
		<view class="bottom-subside"></view>
		<view class="bx-bottom">
			<view class="btn-left" @click="$dianji(togoSubmitCurrent,'onoff2')">返回并保存当前</view>
			<view class="btn-right" @click="$dianji(togoSubmitVerify,'onoff')">提交验证</view>
		</view>
		<!-- 故障类型 -->
		<u-popup :show="showgzType" mode="bottom" :round="10" @close="close" @open="open">
			<view style="padding: 16rpx 0;color: #8c8c8c;font-size: 30rpx; text-align: center;border-bottom: 1px solid #f5f5f5;height: 80rpx;line-height: 80rpx;">请选择故障类型</view>
			<view class="sex-select" style="min-height: 84rpx;max-height: 45vh;">
				<view class="sex-item" @click="updateItem(item)" v-for="(item,index) in failureList" :key="index">
					{{item.failureName}}
				</view>
			</view>
			<view style="height: 60rpx;">
			</view>
		</u-popup>
		<!-- 故障现象 -->
		<u-popup :show="showgzType2" mode="bottom" :round="10" @close="close2" @open="open2">
			<view style="padding: 16rpx 0;color: #8c8c8c;font-size: 30rpx; text-align: center;border-bottom: 1px solid #f5f5f5;height: 80rpx;line-height: 80rpx;">请选择故障现象</view>
			<view class="sex-select" style="min-height: 84rpx;max-height: 45vh;">
				<view class="sex-item" @click="updateItem2(item)" v-for="(item,index) in failureList2" :key="index">
					{{item.failureName}}
				</view>
			</view>
			<view style="height: 60rpx;">
			</view>
		</u-popup>
		<!-- 故障等级 -->
		<u-popup :show="showGrade" mode="bottom" :round="10"  @close="close3" @open="open3">
			<view style="padding: 16rpx 0;color: #8c8c8c;font-size: 30rpx; text-align: center;border-bottom: 1px solid #f5f5f5;height: 80rpx;line-height: 80rpx;">请选择故障等级</view>
			<view class="sex-select" style="min-height: 84rpx;max-height: 45vh;">
				<view class="sex-item" @click="updateItem3(item)" v-for="(item,index) in gradeList" :key="item.id">
					{{item.configValue}}
				</view>
			</view>
			<view style="height: 60rpx;">
			</view>
		</u-popup>
	</view>
</template>

<script>
	import json from '../../subPackagesA/repairList/data.js';
	import uploadVideo from '@/components/uploadVideo/index.vue'
	export default {
		components: {
			uploadVideo
		},
		data() {
			return {
				viList: [],
				imgList: [],
				file: '',
				topheight: 0,
				activeStyle: {
					color: '#0F53AC',
					fontWeight: 'bold',
					transform: 'scale(1.05)'
				},
				inactiveStyle: {
					color: '#8c8c8c',
					transform: 'scale(1)'
				},
				itemStyle: {
					paddingLeft: '30rpx',
					paddingRight: '30rpx',
					paddingTop: '24rpx',
					paddingBottom: '24rpx',
					height: '48rpx'
				},
				current: 0,
				tabList: [{
						name: '维修信息',
					},
					{
						name: '备件申请',
					}
				],
				bjapplyList: [],
				value1: "",
				value2: "",
				fileList: [],
				list: [],
				infoParams: {},
				orderNum: '',
				dataInfo: {}, //详情信息
				showgzType: false,
				showgzType2: false,
				showGrade: false,
				failureList: [], //故障类型集合
				failureList2: [], //故障现象集合
				gradeList: [],
				gzPictrueList: [],
				wxpeopleList: {},
				wxpeopleList5: {
					realName: '',
					id: ''
				},
				addBjList: {},
				dataParams: {
					orderNum: '', //非必须 维修工单号
					approveStatus: '', //非必须 审核状态；0.待提交  1.待审核    2.已审核
					deviceId: '', //非必须 申请的设备id
					partApplyDetails: [], //非必须 维修工单号
					dealUser: '', //审核人Id
					dealUserName: ''
				},
				currentParams: {
					id: '',
					deviceId: '', //	string	必须 维修的设备id
					failureCategoryId: '', //string 必须 故障类型id		
					failureCategory: '', //	string	必须 故障类型	
					failurePhenomenonId: '', //	string	必须 故障现象id	
					failurePhenomenon: '', //	string	必须 故障现象	
					solution: '', //	string	必须 解决方案	
					failureLevelId: '', //	string	必须 故障等级id	
					failureLevel: '', //	string	必须 故障等级	
					description: '', //	string	必须 故障描述	
					failurePictures: '', //	string	非必须 故障照片，多个之间用“,”分隔	
					repairUserName: '', //	string	必须 维修人姓名	
					content: '', //	string	必须 维修内容	
					repairPictures: '', //	string	非必须 维修照片，多个之间用","隔开	
					verifyUserId: '', //	string	必须 验证人id	
					verifyUserName: '', //	string	必须 验证人姓名	
					repairOrderNum: '', //	string	非必须 维修工单号，有则传	
					repairId: '' //	strin
				},
				deviceType: '',
				onoff: true,
				onoff2: true,
				fileList1: [],
				//这里存储一下审核人id
				uid: '',
				uName: ''
			}
		},
		onLoad(options) {
			this.bjapplyList = []
			this.infoParams = json.data;
			if (options) {
				this.orderNum = options.orderNum;
				this.infoParams.deviceId = options.deviceId;
				this.infoParams.id = options.repairId;
				this.deviceType = options.deviceType;
			}
			this.getDetailInfo();

			this.getfailureTermList(options.deviceType)
			// this.getfailureTermList();



			this.getgradeList(); //获取故障等级
			uni.$on('comList2', (data) => {
				this.bjapplyList = [];
				if (data.partUsageResponse.length > 0) {
					data.partUsageResponse.forEach(s => {
						this.bjapplyList.push(s);
					})
				}
			})
		},
		onShow() {
			if (this.wxpeopleList && this.wxpeopleList.id) {
				this.infoParams.verifyUserName = this.wxpeopleList.realName;
				this.infoParams.verifyUserId = this.wxpeopleList.id;
				this.currentParams.verifyUserName = this.wxpeopleList.realName;
				this.currentParams.verifyUserId = this.wxpeopleList.id;
			}
			if (this.wxpeopleList5 && this.wxpeopleList5.id) {
				this.dataParams.dealUser = this.wxpeopleList5.id;
				this.dataParams.dealUserName = this.wxpeopleList5.realName;
			}
		},
		methods: {
			previewImage: function(e, s) {
				uni.previewImage({
					current: e,
					urls: s,
				});
			},
			tabsClick(e) {
				this.current = e.index
			},
			addBeijianChange(type) {
				// if (!this.listInfo.deviceId) return uni.$u.toast('报修设备信息不能为空');
				uni.navigateTo({
					url: '/pages/subPackagesB/weiwaiRepair/bjselect?deviceType=' + this.deviceType + '&bjType=' +
						type +
						'&repairOrderNum=' + this.orderNum + '&bjapplyList=' +
						encodeURIComponent(JSON.stringify(this.bjapplyList))
				})
			},
			//获取故障等级
			getgradeList() {
				uni.$u.http.post(`/device/mobile/sysDataDictionary/dictionaryList`, {
					configType: "failure_level"
				}).then(res => {
					if (res.code == 0) {
						this.gradeList = res.data;
					}
				}).catch(err => {})
			},
			getfailureTermList(deviceType) {
				this.failureList = []
				uni.$u.http.get(`/device/mobile/deviceFailureTerm/getFailureCategory/${deviceType}`).then(res => {
					if (res.code == 0) {
						this.failureList = res.data;
					}
				}).catch(err => {
					uni.$u.toast(`${err}`);
				})
			},
			// getfailureTermList() {
			// 	uni.$u.http.post(`/device/mobile/deviceFailureTerm/failureTermList`, {
			// 		pn: 1,
			// 		ps: 100
			// 	}).then(res => {
			// 		if (res.code == 0) {
			// 			this.failureList = res.data.records;
			// 		}
			// 	}).catch(err => {})
			// },
			getDetailInfo() {
				uni.$u.http.get(`/device/mobile/deviceRepair/repairDetailByOrderNum/${this.orderNum}`).then(res => {
					if (res.code == 0) {
						this.dataInfo = res.data;
						this.currentParams.deviceId = this.dataInfo.deviceId;
						this.currentParams.description = this.dataInfo.description;
						this.currentParams.failurePictures = this.dataInfo.failurePictures;
						this.currentParams.id = this.dataInfo.id;
						this.currentParams.repairOrderNum = this.dataInfo.repairOrderNum;
						this.infoParams.failurePictures = this.dataInfo.failurePictures;
						this.infoParams.description = this.dataInfo.description;
						this.infoParams.repairOrderNum = this.dataInfo.repairOrderNum;
						this.dataParams.orderNum = this.dataInfo.repairOrderNum;
						//故障类型
						this.infoParams.failureCategory = this.dataInfo.failureCategory;
						this.infoParams.failureCategoryId = this.dataInfo.failureCategoryId;
						this.currentParams.failureCategory = this.dataInfo.failureCategory;
						this.currentParams.failureCategoryId = this.dataInfo.failureCategoryId;
						//故障现象
						this.infoParams.failurePhenomenonId = this.dataInfo.failurePhenomenonId;
						this.infoParams.failurePhenomenon = this.dataInfo.failurePhenomenon;
						this.currentParams.failurePhenomenonId = this.dataInfo.failurePhenomenonId;
						this.currentParams.failurePhenomenon = this.dataInfo.failurePhenomenon;
						//解决方案
						this.infoParams.solution = this.dataInfo.solution;
						this.currentParams.solution = this.dataInfo.solution;
						//故障等级
						this.infoParams.failureLevelId = this.dataInfo.failureLevelId;
						this.infoParams.failureLevel = this.dataInfo.failureLevel;
						this.currentParams.failureLevelId = this.dataInfo.failureLevelId;
						this.currentParams.failureLevel = this.dataInfo.failureLevel;
						//维修内容
						this.infoParams.content = this.dataInfo.content;
						this.currentParams.content = this.dataInfo.content;
						//维修照片
						this.infoParams.repairPictures = this.dataInfo.repairPictures;
						this.currentParams.repairPictures = this.dataInfo.repairPictures;
						this.fileList1 = []
						if (this.dataInfo.repairPictures != "") {
							var pictures = this.dataInfo.repairPictures.split(',')
							pictures.forEach(s => {
								let dd = {
									url: s
								}
								this.fileList1.push(dd);
							})
						}
						//故障照片
						this.file = this.dataInfo.repairPictures
						this.handleFileList(this.dataInfo.failurePictures)
						// console.log('repairPictures',this.dataInfo.repairPictures)
						// console.log('this.fileList1',this.fileList1)
						//验证人
						this.infoParams.verifyUserName = this.dataInfo.verifyUserName;
						this.infoParams.verifyUserId = this.dataInfo.verifyUserId;
						this.currentParams.verifyUserName = this.dataInfo.verifyUserName;
						this.currentParams.verifyUserId = this.dataInfo.verifyUserId;
						this.dataParams.dealUser = this.dataInfo.dealUser;
						this.dataParams.dealUserName = this.dataInfo.dealUserName;
						this.uid = this.dataInfo.dealUser;
						this.uName = this.dataInfo.dealUserName;
						//备件回显
						this.bjapplyList = [];
						if (this.dataInfo.partList.length > 0) {
							this.dataInfo.partList.forEach(s => {
								this.bjapplyList.push(s);
							})
						}

					}
				}).catch(err => {})
			},
			//处理图片
			getpictureList(pictureinfo) {
				if (pictureinfo) {
					var splitAdd = pictureinfo.split(",");
					return splitAdd
				} else {
					return []
				}
			},
			open() {},
			close() {
				this.showgzType = false
			},
			open2() {},
			close2() {
				this.showgzType2 = false
			},
			open3() {},
			close3() {
				this.showGrade = false
			},
			//故障类型选择
			togohitchSelect() {
				if (this.failureList.length <= 0) return uni.$u.toast('无数据选择，可在用户PC端后台进行配置');
				this.showgzType = true;
			},
			updateItem(item) {
				this.infoParams.failureCategoryId = item.id;
				this.infoParams.failureCategory = item.failureName;
				this.currentParams.failureCategoryId = item.id;
				this.currentParams.failureCategory = item.failureName;
				this.showgzType = false;
				this.infoParams.failurePhenomenonId = '';
				this.infoParams.failurePhenomenon = '';
				this.infoParams.solution = '';
			},
			//故障现象
			togoSymptoms() {
				if (!this.infoParams.failureCategoryId) return uni.$u.toast('请先选择故障类型');
				this.getFailurePhenomenon(this.infoParams.failureCategoryId, true)

			},
			getFailurePhenomenon(failureCategoryId, type) {
				uni.$u.http.get(`/device/mobile/deviceFailureTerm/getFailurePhenomenon/${failureCategoryId}`).then(res => {
					if (res.code == 0) {
						this.failureList2 = res.data;
						if (type && res.data.length == 0) {
							this.showgzType2 = false;
							return uni.$u.toast('无数据选择，可在用户PC端后台进行配置');
						} else {
							this.showgzType2 = true;
						}
					}
				}).catch(err => {
					uni.$u.toast(`${err}`);
				})
			},
			changeSolution(e) {
				this.currentParams.solution = e;
			},
			updateItem2(item) {
				this.infoParams.failurePhenomenonId = item.id;
				this.infoParams.failurePhenomenon = item.failureName;
				this.infoParams.solution = item.solution
				this.currentParams.failurePhenomenonId = item.id;
				this.currentParams.failurePhenomenon = item.failureName;
				this.currentParams.solution = item.solution;
				this.showgzType2 = false;
			},
			//故障等级选择
			togoPopGrade() {
				this.showGrade = true;
			},
			updateItem3(item) {
				this.infoParams.failureLevelId = item.id;
				this.infoParams.failureLevel = item.configValue;
				this.currentParams.failureLevelId = item.id;
				this.currentParams.failureLevel = item.configValue;
				this.showGrade = false;
			},
			getdata(e) {
				this.gzPictrueList = e;
				this.fileList1 = [];
				if (this.gzPictrueList.length > 0) {
					this.infoParams.repairPictures = "";
					let arry = []
					this.gzPictrueList.map(item => {
						arry.push(item)
					})
					this.fileList1 = arry.toString()
					this.infoParams.repairPictures = arry.toString()
					this.currentParams.repairPictures = arry.toString();
				}
			},
			//删除图片
			deletePicture(e) {
				this.gzPictrueList = e;
				this.fileList1 = [];
				if (this.gzPictrueList.length > 0) {
					this.infoParams.repairPictures = "";
					let arry = []
					this.gzPictrueList.map(item => {
						arry.push(item)
					})
					this.fileList1 = arry.toString()
					this.infoParams.repairPictures = arry.toString()
					this.currentParams.repairPictures = arry.toString();
				}

			},
			handleFileList(data) {
				let fileInfo = data
				if (fileInfo) {
					let fileList = fileInfo.split(",")
					fileList.forEach(item => {
						let str = item.split('?')[0]
						if (str.substring(str.length - 3, str.length) == 'mp4') {
							this.viList.push(item)
						} else {
							this.imgList.push(item)
						}
					})
				}
			},
			togoPeopleSelect(type) {
				if (type == 5) {
					if (this.bjapplyList.some(item => item.approveStatus != 0)) {
						uni.$u.toast('该状态不能修改审核人');
						return
					}
				}
				uni.navigateTo({
					url: '/pages/subPackagesC/list/peoplelist?type=' + type
				})
				// if (this.dataParams.dealUser!="") {
				// 	return uni.$u.toast('已有备件审核人');
				// } else {
				// 	uni.navigateTo({
				// 		url: '/pages/subPackagesA/list/peoplelist?type=' + type
				// 	})
				// }
			},
			//删除备件
			deleteBjItem(e) {
				var that = this;
				uni.showModal({
					title: '提示',
					content: '确定删除该备件吗？',
					success: function(res) {
						if (res.confirm) {
							// that.bjapplyList.splice(e.index, 1);
							that.getDeletePart(e.item.id);
						} else if (res.cancel) {}
					}
				});

			},
			getDeletePart(id) {
				uni.$u.http.post(`/device/mobile/devicePartApply/deletePartApplyDetail/${id}`).then(
					res => {
						if (res.code == 0) {
							uni.$u.toast('删除成功')
							this.bjapplyList = res.data;
						}
					}).catch(err => {})
			},
			//提交申请
			togoComfirApplybtn() {
				var that = this;
				if (!that.bjapplyList.filter(item => item.approveStatus == 0).length) {
					return uni.$u.toast('没有可提交的数据')
				}
				if (!that.dataParams.dealUser) return uni.$u.toast('请选择审核人员')
				if (that.uName && that.dataParams.dealUser !== that.uid) return uni.$u.toast(`当前审核人为${that.uName},请勿变更`)
				that.bjapplyList.forEach(item => {
					if (item.approveStatus == 0) {
						let dd = {
							partId: item.id,
							amount: item.totalAmount
						}
						that.dataParams.partApplyDetails.push(dd)
					}
				})
				that.dataParams.approveStatus = 1;
				that.getAddRepairPartApply();

			},
			getAddRepairPartApply() {
				var that = this;
				uni.$u.http.post(`/device/mobile/deviceRepair/addRepairPartApply`, that.dataParams).then(
					res => {
						if (res.code == 0) {
							uni.$u.toast('提交成功')
							// that.listInfo.repairOrderNum = res.data.orderNum;
							if (res.data.partUsageResponse.length > 0) {
								that.bjapplyList = [];
								that.bjapplyList = res.data.partUsageResponse;
							}
							// that.dataParams.dealUser = '';
							that.wxpeopleList5.id = '';
							that.wxpeopleList5.realName = '';
						}
					}).catch(err => {})
			},
			//返回并保存当前
			togoSubmitCurrent() {
				this.togoSubmitCurrent2()

			},
			togoSubmitCurrent2() {

				// this.dataParams
				if (!this.currentParams.deviceId) return uni.$u.toast('维修设备不能为空')
				this.currentParams.content = this.infoParams.content;
				uni.$u.http.post(`/device/mobile/deviceRepair/updateRepair`, this.currentParams).then(res => {
					if (res.code == 0) {
						uni.$u.toast('提交成功')
						setTimeout(() => {
							uni.navigateTo({
								url: '/pages/subPackagesA/repairList/index?currentStatus=2'
							})
						}, 1000)
					}
				}).catch(err => {})
			},
			showTanchung() {

				var that = this;
				uni.showModal({
					title: '提示',
					content: '有备件待提交申请， 确定提交验证信息？',
					confirmText: '确定',
					cancelText: '取消',
					success: function(res) {
						if (res.confirm) {
							that.fix()
						} else if (res.cancel) {

						}
					}
				});
			},
			fix() {
				uni.$u.http.get(
						`/device/mobile/devicePartApply/judgePartApply/${this.orderNum}/1`)
					.then(res => {
						if (res.code == 0) {
							if (res.data) {
								this.getSubmitVerify()
							} else {
								uni.$u.toast('当前有备件待审核，无法提交')
								return
							}
						}
					}).catch(err => {})
			},
			//提交验证
			togoSubmitVerify() {
				let isConfirm = true;
				if (!this.infoParams.failureCategoryId) return uni.$u.toast('请选择故障类型');
				if (!this.infoParams.failurePhenomenon) return uni.$u.toast('请选择故障现象');
				if (!this.infoParams.solution) return uni.$u.toast('请输入解决方案');
				if (!this.infoParams.failureLevelId) return uni.$u.toast('请选择故障等级');
				if (!this.infoParams.content) return uni.$u.toast('请输入维修内容');
				if (!this.infoParams.repairPictures) return uni.$u.toast('请上传维修照片');
				if (!this.infoParams.verifyUserId) return uni.$u.toast('请选择验证人');
				if (this.bjapplyList.length > 0) {
					this.bjapplyList.forEach(item => {
						if (item.approveStatus == 0) {
							isConfirm = false;
						}
					})
				}
				if (!isConfirm) {
					this.showTanchung();
					return
				}
				if (isConfirm) {
					uni.$u.http.get(
							`/device/mobile/devicePartApply/judgePartApply/${this.orderNum}/1`)
						.then(res => {
							if (res.code == 0) {
								if (res.data) {
									this.getSubmitVerify()
								} else {
									isConfirm = false;
									uni.$u.toast('当前有备件待审核，无法提交')
									return
								}
							}
						}).catch(err => {})
				}
			},
			getSubmitVerify() {
				uni.$u.http.post(`/device/mobile/deviceRepair/submitVerify`, this.infoParams).then(res => {
					if (res.code == 0) {
						uni.$u.toast('提交成功')
						setTimeout(() => {
							uni.navigateTo({
								url: '/pages/subPackagesA/repairList/index'
							})
						}, 1000)
					}
				}).catch(err => {})
			},
			//点击返回按钮
			leftClick() {
				var that = this;
				uni.showModal({
					title: '提示',
					content: '是否返回并保存当前？',
					confirmText: '保存',
					cancelText: '不保存',
					success: function(res) {
						if (res.confirm) {
							that.togoSubmitCurrent2();
						} else if (res.cancel) {
							uni.switchTab({
								url: '/pages/work/index'
							})
						}
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #FFFFFF;
	}

	.bx-list {
		background: #fff;

		.bx-list-title {
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 30rpx 20rpx;

			.left {
				display: flex;
				font-size: 34rpx;
				font-weight: 400;
				letter-spacing: 0px;
				line-height: 0px;
				color: rgba(0, 0, 0, 1);
			}

			.right {
				display: flex;
				justify-content: space-around;
				width: 50%;

				.sm-add {
					display: flex;
					align-items: center;
					padding: 10rpx 20rpx;
					border-radius: 24rpx;
					color: #0F53AC;
					background-color: rgba(2, 173, 130, 0.3);
					font-size: 24rpx;
				}

				.sm-sd {
					display: flex;
					align-items: center;
					padding: 10rpx 20rpx;
					border-radius: 24rpx;
					color: #0F53AC;
					background-color: rgba(2, 173, 130, 0.3);
					font-size: 24rpx;
				}
			}

			.right1 {
				display: flex;
				align-items: center;
				font-size: 34rpx;
				color: #8c8c8c;

				.right-input {
					width: 100%;
					text-align: right;
					display: flex;
					align-items: center;
				}
				
				.select-bg {
				  color: #000000;
				}
			}
		}

		.bx-info {
			display: flex;
			padding: 10rpx 20rpx 20rpx 20rpx;

			.left-icon {
				image {
					width: 96rpx;
					height: 96rpx;
				}
			}

			.right-txt {
				padding-left: 32rpx;

				.txt1 {
					color: #000000;
					font-size: 34rpx;
					font-weight: 400;
				}

				.txt2 {
					color: #8c8c8c;
					font-size: 28rpx;
					margin-top: 10rpx;
				}
			}

		}

		.input-textrea {
			margin: 20rpx;
			border-radius: 8rpx;
			background: #f2f2f2;

			.textrea {
				background: #f2f2f2;
			}
		}

	}

	.bx-title {
		background: #fff;
		padding: 20rpx;

		.left {
			display: flex;
			font-size: 34rpx;
			font-weight: 400;
			letter-spacing: 0px;
			line-height: 0px;
			color: rgba(0, 0, 0, 1);
			background: #fff;
		}
	}

	.bx-upload {
		padding: 20rpx 30rpx;
		background: #fff;
	}

	.bx-title2 {
		color: #8c8c8c;
		font-size: 28rpx;
		padding: 30rpx 30rpx 0 30rpx;
		background: #FFFFFF;
		margin-top: 2rpx;
		position: fixed;
		bottom: 180rpx;
		z-index: 9;
	}

	.bottom-subside {
		width: 100%;
		height: 280rpx;
	}

	.bx-bottom {
		width: 100%;
		background: #FFFFFF;
		display: flex;
		justify-content: space-around;
		align-items: center;
		padding: 33rpx 0 80rpx 0;
		position: fixed;
		z-index: 9;
		bottom: 0;

		.btn-left {
			width: 45%;
			height: 90rpx;
			border-radius: 12rpx;
			background: #ffffff;
			display: flex;
			justify-content: center;
			align-items: center;
			color: #0F53AC;
			border: 1px solid #0F53AC;
			font-size: 34rpx;
			font-weight: 500;
			letter-spacing: 0px;
			line-height: 0px;
		}

		.btn-right {
			width: 45%;
			height: 90rpx;
			border-radius: 12rpx;
			background: rgba(15, 83, 172, 1);
			display: flex;
			justify-content: center;
			align-items: center;
			color: #fff;
			font-size: 34rpx;
			font-weight: 500;
			letter-spacing: 0px;
			line-height: 0px;
			border: 1px solid #0F53AC;
		}
	}

	.tab-list {
		display: flex;
		padding: 20rpx 0 20rpx 20rpx;
		border-radius: 8rpx;
		background: #f2f2f2;
		margin-top: 20rpx;

		.tab-left {
			border-radius: 8rpx;
			display: flex;
			align-items: center;

			image {
				width: 96rpx;
				height: 96rpx;
				border-radius: 8rpx;
			}
		}

		.tab-right {
			width: 100%;
			padding: 0 10rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.data-txt {
				.txt1 {
					font-size: 34rpx;
					color: #000000;
				}

				.txt2 {
					font-size: 28rpx;
					color: #8c8c8c;
					margin-top: 10rpx;
				}
			}
		}

	}

	.add-file {
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 12rpx;
		border: 1px solid #0F53AC;
		margin-top: 30rpx;
		padding: 20rpx 0;
		color: #0F53AC;
	}

	.not-data {
		background: #ffffff;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		margin-top: 2rpx;
		padding: 100rpx 0;

		image {
			width: 170rpx;
		}

		.txt1 {
			font-size: 30rpx;
			color: #8c8c8c;
			padding-top: 40rpx;
		}

		.txt2 {
			font-size: 34rpx;
			color: #0F53AC;
			margin-top: 40rpx;
			border: 1px solid #0F53AC;
			border-radius: 12rpx;
			padding: 20rpx 80rpx;
		}
	}

	.search-title {
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 24rpx;
		color: #8c8c8c;
		padding: 20rpx 30rpx;
	}

	.search-list {
		background: #fff;
		margin-top: 2rpx;


		.search-item {
			padding: 30rpx;
			border-bottom: 1px solid #f2f2f2;

			.item-top {
				display: flex;
				align-items: center;

				.item-name {
					color: #000000;
					font-size: 34rpx;
				}

				.item-txt {
					padding: 20rpx 0 20rpx 10rpx;
					display: flex;
					width: 100%;

					.left-icon {
						border-radius: 8rpx;

						image {
							width: 152rpx;
							height: 152rpx;
							border-radius: 8rpx;
						}
					}

					.right-txt {
						padding-left: 32rpx;
						width: 100%;

						.txt-left {
							display: flex;
							// align-items: center;
							justify-content: space-between;

							.txt1 {
								width: 400rpx;
								height: 75rpx;
								font-size: 34rpx;
								color: #000000;
								padding-bottom: 20rpx;
								overflow: hidden;
								text-overflow: ellipsis;
								display: -webkit-box;
								-webkit-box-orient: vertical;
								-webkit-line-clamp: 2;
							}

							.txt-status {
								font-size: 30rpx;
								color: #1962e0;
							}
						}

						.txt-right {
							display: flex;
							align-items: center;
							justify-content: space-between;
							padding-top: 10rpx;

							.txt2 {
								font-size: 28rpx;
								color: #8c8c8c;
							}

							.addnum {
								display: flex;
								align-items: center;
								font-size: 28rpx;

								.delete-btn {
									color: #fa4016;
									margin-left: 10rpx;
									font-size: 40rpx;
								}

								.total {
									color: #000000;
								}
							}
						}
					}
				}

			}


		}
	}

	.search-btn {
		display: flex;
		justify-content: space-around;
		align-items: center;
		padding: 30rpx;
		background: #ffffff;

		.btn {
			border: 1px solid #0F53AC;
			color: #0F53AC;
			font-size: 34rpx;
			border-radius: 12rpx;
			padding: 20rpx 0;
			width: 40%;
			text-align: center;

		}
	}

	.gz-desc {
		padding: 15rpx 30rpx;
		background: #ffffff;

		.title {
			font-size: 28rpx;
			color: #8c8c8c;
		}

		.desc-reason1 {
			font-size: 28rpx;
			color: #2b2b2b;
			margin-top: 15rpx;
			// overflow: hidden;
			// text-overflow: ellipsis;
			// display: -webkit-box;
			// -webkit-line-clamp: 2;
			// -webkit-box-orient: vertical;
		}
	}

	.gz-icon {
		padding: 30rpx;
		border-bottom: 1px solid #f2f2f2;
		background: #ffffff;

		.title {
			font-size: 34rpx;
			color: #8c8c8c;
		}

		.icon-list {
			padding-top: 20rpx;
		}

	}

	.sex-select {
		.sex-item {
			word-break: break-all;
			word-wrap: break-word;
			display: flex;
			justify-content: center;
			align-items: center;
			padding: 20rpx;
			border-bottom: 1px solid #f2f2f2;
		}
	}

	.select-look {
		padding-left: 30rpx;
		padding-bottom: 30rpx;
		padding-right: 30rpx;
		word-wrap: break-word;

		.look-item {
			// padding: 10rpx 20rpx;
			padding: 2rpx 16rpx;
			border-radius: 24rpx;
			// color: #0F53AC;
			// background-color: rgba(2, 173, 130, 0.3);
			font-size:30rpx;
		}
	}

	.u-tabs__wrapper__nav__item {
		// padding: 0 !important;
		width: 50%;
	}
</style>